package offer.of09;

import java.util.Stack;

public class Solution {
}
class CQueue {
    Stack<Integer> stack=new Stack<>();
    Stack<Integer> stack1=new Stack<>();
    public CQueue() {

    }

    public void appendTail(int value) {
        stack.push(value);
    }

    public int deleteHead() {

        if(stack.isEmpty()&&stack1.isEmpty()){
            return -1;
        }
        int res=-1;
        if(stack1.isEmpty()){
            while(!stack.isEmpty()){
                stack1.push(stack.pop());
            }
        }
        res=stack1.pop();
        return res;
    }
}

/**
 * Your CQueue object will be instantiated and called as such:
 * CQueue obj = new CQueue();
 * obj.appendTail(value);
 * int param_2 = obj.deleteHead();
 */